<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    span {
      display: inline-block;
      width: 70px;
      border: 1px solid black;
      background-color: skyblue;
      text-align: center;
      margin: 3px;
    }
  </style>
</head>

<body>



  <script>
    //  1.外层循环控制行数  需要换行 
    //  2.里层循环控制列数  里面的个数跟着外层循环走，需要(i x j=ij)这种形式
    //  3.需要for的双重循环
    for (let i = 1; i <= 9; i++) {
      for (let j = 1; j <= i; j++) {
        document.write(`<span>${j}x${i}=${j * i}</span>`)
        // 注意：每次i再次循环时，j的值都是从1开始
      }
      document.write(`<br>`)
    }
  </script>
</body>

</html>